<template>
	<div>
		<app-nav-tab></app-nav-tab>
		<div class="mui-content has-bottom-bar">
			<div class="top-box">
				<div class="top-content-box">
					<div class="main-info">
						<img src="../../../assets/images/mind/mind-user-bg.png" class="header-icon">
						<template v-if="!islogin">
							<router-link :to="{name:'Login'}">
								<span class="btn-span">登录</span>
							</router-link>
							<span class="btn-span">注册</span>
						</template>
						<h3 v-if="islogin" class="title-name">
						<span style="padding-right: 10px;"> {{time_now}}</span>{{username}}</h3>
					</div>
				</div>
			</div>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<router-link to="/" class="mui-navigate-right">
						<img class="mui-media-object mui-pull-left app-mind-img" src="../../../assets/images/mind/baodan.png">
						<div class="mui-media-body mind-list-li">我的保单</div>
					</router-link>
				</li>
			</ul>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<router-link to="/" class="mui-navigate-right">
						<img class="mui-media-object mui-pull-left app-mind-img" src="../../../assets/images/mind/tongzhi.png">
						<div class="mui-media-body mind-list-li">续保提醒</div>
					</router-link>
				</li>
			</ul>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<router-link to="/" class="mui-navigate-right">
						<img class="mui-media-object mui-pull-left app-mind-img" src="../../../assets/images/mind/shezhi.png">
						<div class="mui-media-body mind-list-li">个人设置</div>
					</router-link>
				</li>
			</ul>
		</div>
	</div>
</template>
<script>
	import NarBar from '../../../components/public/tabNavBar.vue'
	import {getCookie} from '../../../gloabl/common.js'
	export default{
		data(){
			return{
				islogin:true,
				username:'',
				user_info:'',
				time_now:''
			}
		},
		components:{
			'app-nav-tab':NarBar
		},
		created:function(){
			if(getCookie('user_info')){ //已登录
				this.islogin=true;
				this.username=JSON.parse(getCookie('user_info')).user.userprofile.name;
				this.user_info=JSON.parse(getCookie('user_info'));	
				let now = new Date();
				let hour = now.getHours() ;
				if(hour<12){
					this.time_now = '上午好!'
				}else{
					this.time_now = '下午好!'
				}
			}else{
				this.islogin=false;
			}
		}
	}
</script>
<style scoped="scoped">
	.top-box{
		width: 100%;
		height: 175px;
		background-image: linear-gradient(-133deg,#F08800 0%, #FEB207 100%);
		position: relative;
	}
	.top-content-box{
		position: absolute;
		bottom: 18px;
		width: 100%;
		text-align: left;
	}
	.main-info{
		width: 100%;
		padding: 0 15px;
		overflow: hidden;
		line-height: 65px;
	}
	.header-icon{
		height: 65px;
		width: 65px;
		float: left;
	}
	.btn-span{
		margin-left: 20px;
		color: #FFFFFF;
		padding: 10px 30px;
		border: 1px solid #FFFFFF;
	}
	.app-mind-img{
		width: 32px;
		height: 32px;
	}
	.mind-list-li{
		line-height: 32px;
		text-align: left;
		font-size: 14px;
	}
	.mui-table-view{
		margin-bottom: 10px;
	}
	.title-name{
		line-height: 65px;
		color: #FFFFFF;
		font-size: 14px;
		text-align: center;
	}
</style>